/*
 * Copyright (C) 2003-2010 The Music Player Daemon Project
 * http://www.musicpd.org
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
#ifndef SPOTIFY_H
#define SPOTIFY_H

#include "config.h"
#include "locate.h"
#include "dbUtils.h"

#include <glib.h>
#include "conf.h"

#include "input_stream.h"
#include "input/spotify_input_plugin.h"
#include "tag.h"

extern struct despotify_session* despotify_session;

/**
 * Check if the spotify input is enable and then init and start a session.
 */
//void spotify_init(void);
bool spotify_init(const struct config_param *param, GError **error_r);
void spotify_exit(void);

struct input_stream * spotify_open(const char *uri, GError **error_r);
void spotify_close(struct input_stream *is);

size_t spotify_read(struct input_stream *is, void *ptr, size_t size, GError **error_r);

bool spotify_eof(struct input_stream *is);
bool spotify_seek(struct input_stream *is, goffset offset, int whence, GError **error_r);
//struct tag * spotify_tag(struct track * track);

struct song * spotify_uri_to_song(char *uri);
int spotify_search(struct locate_item_list * to_seach, struct search_data *data);
 
#endif
